﻿using B.S.Medical.Api.Read.Application.Command.Doctor;
using B.S.Medical.Api.Read.DTOS;
using B.S.Medical.ErrorCode;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace B.S.Medical.Api.Read.Controllers.Doctor
{
    /// <summary>
    /// 医生管理
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class DoctorController : ControllerBase
    {
        private readonly IMediator mediator;

        public DoctorController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        /// <summary>
        /// 医生条件查询列表分页接口
        /// </summary>
        /// <param name="request">参数</param>
        /// <returns>返回分页包装类</returns>
        [HttpGet]
        public Task<ApiPageing<DoctorDTO>> SearchDoctor([FromQuery]SearchDoctorCommand request)
        {
            return mediator.Send(request);
        }
    }
}
